package com.crealth.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;

public class SupportedVoiceCodecsModel implements Serializable {
	private static final long serialVersionUID = 3016058L;
	
	private int id;  // 支持的声音编码
	private int companyID;
	private int GSM610;
	private int iLBC;
	private int G711A;
	private int G711U;
	private int G729;
	
	public SupportedVoiceCodecsModel() {
		GSM610 = 0;
		iLBC = 0;
		G711A = 0;
		G711U = 0;
		G729 = 0;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getCompanyID() {
		return companyID;
	}
	public void setCompanyID(int companyID) {
		this.companyID = companyID;
	}
	public int getGSM610() {
		return GSM610;
	}
	public void setGSM610(int gSM610) {
		GSM610 = gSM610;
	}
	public int getiLBC() {
		return iLBC;
	}
	public void setiLBC(int iLBC) {
		this.iLBC = iLBC;
	}
	public int getG711A() {
		return G711A;
	}
	public void setG711A(int g711a) {
		G711A = g711a;
	}
	public int getG711U() {
		return G711U;
	}
	public void setG711U(int g711u) {
		G711U = g711u;
	}
	public int getG729() {
		return G729;
	}
	public void setG729(int g729) {
		G729 = g729;
	}
	
	public JSONObject toJSONObject(JSONObject json) {
		JSONObject jsonObj = null;
		if (json != null) {
			jsonObj = json;
		}
		else {
			jsonObj = new JSONObject();
		}		
		jsonObj.put("GSM610", GSM610);
		jsonObj.put("iLBC", iLBC);
		jsonObj.put("G711A", G711A);
		jsonObj.put("G711U", G711U);
		jsonObj.put("G729", G729);
		
		return jsonObj;
	}
	
	public void parseFromJson(JSONObject json) {
		if (json.containsKey("GSM610")) {
			GSM610 = json.getIntValue("GSM610");
		}
		if (json.containsKey("iLBC")) {
			iLBC = json.getIntValue("iLBC");
		}
		if (json.containsKey("G711A")) {
			G711A = json.getIntValue("G711A");
		}
		if (json.containsKey("G711U")) {
			G711U = json.getIntValue("G711U");
		}
		if (json.containsKey("G729")) {
			G729 = json.getIntValue("G729");
		}
		
	}

}
